import 'package:animal/constant/font.dart';
import 'package:animal/utils/screen_util.dart';
import 'package:animal/widgets/image_error.dart';
import 'package:animal/widgets/image_loading.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

///通讯录列表item
class FriendListItem extends StatelessWidget {
  const FriendListItem({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: ScreenUtil().L(30)),
      height: ScreenUtil().L(100),
      child: Row(
        children: [
          SizedBox(
            width: ScreenUtil().l(60),
            height: ScreenUtil().l(60),
            child: ClipRRect(
              borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().l(20))),
              child: CachedNetworkImage(
                imageUrl: "https://cdn.pixabay.com/photo/2017/12/13/00/23/christmas-3015776_960_720.jpg",
                placeholder: (context, url) => const ImageLoadingWidget(),
                errorWidget: (controller, url, err) => ImageErrorWidget(),
                fit: BoxFit.cover,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
          Text("昵称或者备注", style: KFontConstant.myTextStyle(size: 18))
        ],
      ),
    );
  }
}
